<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>添加菜品</title>
    <link rel="stylesheet" type="text/css" href="/orderSystem/css/query.css" />
    <script type="text/javascript" src="/orderSystem/js/jquery-1.11.3.min.js"></script>
    <script type="text/javascript">
        var params=new URLSearchParams(window.location.search);
        var cid=params.get("cid");
        if(cid!=null&&cid!="null"){
                    var url="/orderSystem/queryById.dish";
                    var param={"cid":cid};
                    $.get(url,param,function (data) {
                        var JsonObj=JSON.parse(data);
                        $("#cid").val(JsonObj.cid);
                        $("#dish_description").val(JsonObj.dish_description);
                        $("#dish_type").val(JsonObj.dish_type);
                        $("#dish_name").val(JsonObj.dish_name);
                        $("#price").val(JsonObj.price);
            });
        }
    </script>
</head>
<body>
<div id="top">·当前位置：  -- 添加菜品</div>
<form action="/orderSystem/addOrUpdate.dish" method="post">
    <table id="tab" style="margin-top: 30px; border-collapse:separate; border-spacing:0px 10px;">
        <tr>
            <td align="right">菜品ID : </td>
            <td align="left">&nbsp;<input type="text" id="cid" placeholder="新增无需填写" readonly="readonly" name="cid"/></td>
        </tr>
        <tr>
            <td align="right" style="width:40%;">菜品名称 : </td>
            <td align="left">&nbsp;<input type="text" id="dish_name" name="dish_name"/><span
                    style="color: red"> *</span><span id="message0" style="color: red;" class="message"></span></td>
        </tr>
        <tr>
            <td align="right" style="width:40%;">菜品价格 : </td>
            <td align="left">&nbsp;<input type="text" id="price" name="price"/><span
                    style="color: red"> *</span><span id="message2" style="color: red;" class="message"></span></td>
        </tr>
        <tr>
            <td align="right" style="width:40%;">菜品类别 : </td>
            <td align="left">&nbsp;<input type="text" id="dish_type" name="dish_type"/><span
                    style="color: red"> *</span><span id="message3" style="color: red;" class="message"></span></td>
        </tr>
        <tr>
            <td align="right">菜品描述 : </td>
            <td align="left">&nbsp;<textarea id="dish_description" name="dish_description"></textarea><span
                    style="color: red"> *</span><span id="message1" style="color: red;" class="message"></span></td>
        </tr>
        <tr>
            <td colspan="2"><input style="width: 60px;" type="submit" id="submit"
                                   value="提交" /></td>
        </tr>
    </table>
</form>
</body>
</html>